<template>
    <view>
        <view class="type-header">
            注册类型
        </view>

        <view>
            <view class="item" :class="[selectIndex==index?'check':'' ]" v-for="(item,index) in data" :key="index" @click="select(index)">
                {{item}}
            </view>
        </view>

    </view>
</template>

<script>

export default {
	data() {
		return {
			selectIndex: 0
		}
	},
	props: {
		// 开启动画
		data: {
			type: Array,
			default: []
		}
	},
	methods: {
		select(index) {
			if (index == 0 && this.data[index] == '请选择') {
				return
			}
			this.selectIndex = index
			this.$emit('childFn', index)
			// this.$emit()
		}
	}
}
</script>

<style lang="scss" scoped>
.type-header {
    text-align: center;
    height: 100rpx;
    line-height: 100rpx;
    font-size: 32rpx;
}
.item {
    font-size: 32rpx;
    padding: 30rpx;
}
.check {
    color: #f6380c;
}
</style>
